﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using A2DFramework.SQLDispatcherService;
using A2DFramework.SQLDispatcherService.Configuration;
using A2DFramework.SQLDispatcherService.SimpleADOdotNetDispatcher;

namespace Demo.SqlDispatcherConsole
{
    [SQLDispatcherHandler]
    class Query
    {
        public void Test0()
        {
            string region = SQLDispatcherContext.GetCurrentContext().Region;
            DB db = DBSelector.SelectDB("UPDATE   ", region);
            Console.WriteLine(db.ConnectionString);
        }

        public void Test1()
        {
            string region = SQLDispatcherContext.GetCurrentContext().Region;
            DB db = DBSelector.SelectDB("SELECT   ", region);
            Console.WriteLine(db.ConnectionString);
        }

        [SQLDispatcher("Sales")]
        public void Test2()
        {
            string region = SQLDispatcherContext.GetCurrentContext().Region;
            DB db = DBSelector.SelectDB("SELECT   ", region);
            Console.WriteLine(db.ConnectionString);
        }
    }
}
